		$('#headbox').load('php/header.php');
		$('#footbox').load('php/footer.php');
		/*****页面切换****/
		$('#title').click(function(e){
			var target=e.target;
			if(target.nodeName=="LI"){
				$(target).addClass('title').siblings().removeClass('title');
			}
			var divs=$('#main [id^="main_"]');
			for(var i=0;i<divs.length;i++){
				divs[i].style.display="none";
			}
			var i=$(target).attr('i');
			divs[i].style.display="block";
		});
		/******表单验证*****/
		jQuery.validator.addMethod('cellphone',function(value){
		  var reg = /^1[3578]\d{9}$/;
		  return reg.test(value);
		});
		$('#main_house').validate({
		  //指定每个输入的验证规则
		  rules:{
			useName: {
			  required:true,
			  minlength:4,
			  maxlength:12
			},
			borrowing: {
			  required: true,
			  range:[0,10]
			},
			term: {
			  required: true,
			  range:[1,36]
			},
			phone: {
			  cellphone: true
			},
			house:{
			  required: true,
			  range:[1,10]	
			},
			cost: {
			  required: true,
			  range:[0,120]
			},
			/*application：{
			  required: true
			},*/
			describe: {
			  required: true,
			  minlength:10,
			  maxlength:200
			},
			keyword:{
			  digits:true
			},
		  },  
		  //验证失败后的提示信息
		  messages:{
			useName: {
			  required: '用户名不能为空',
			  minlength:'用户名在4~12位字符之间',
			  maxlength:'用户名在4~12位字符之间'
			},
			borrowing: {
			  required: '必填',
			  range:'借款金额必须在1~10万内'
			},
			term: {
			  required: '必填',
			  range:'借款期限必须在1~36个月内'
			},
			phone: {
			  cellphone: '手机号码不对'
			},
			house:{
			  required: '必填',
			  range:'房产为1~10套'
			},
			cost: {
			  required: '必填',
			  range:'房产总值不能为空'
			},
			/*application：{
			  required: '必选'
			},*/
			describe: {
			  required: '描述不能为空',
			  minlength:'请用10~200个字描述',
			  maxlength:'请用10~200个字描述'
			},
			keyword:{
			  digits:'验证码不对'
			},
		  }
		});
